program q126;
var
    s: string;
    n, i, j, a, b: longint;
    c: string;
begin
    assign(input, '');
    assign(output, '');
    reset(input);
    rewrite(output);

    readln(n);
    for i:=1 to n do
    begin
        readln(s);
        c := s[1];
        j := 3;
        a := 0;
        while (s[j] <> ' ') do
        begin
            a := a * 10 + ord(s[j]) - ord('0');
            inc(j);
        end;
        inc(j);
        b := 0;
        while (j <= length(s)) do
        begin
            b := b * 10 + ord(s[j]) - ord('0');
            inc(j);
        end;

        if (c = '+') then
            writeln(a + b)
        else if (c = '-') then
            writeln(a - b)
        else if (c = '*') then
            writeln(a * b)
        else
        begin
            if (a mod b = 0) then
                writeln(a div b)
            else
                writeln(a / b:0:2);
        end;
    end;

    close(input);
    close(output);
end.
